package com.xgp.order.feign;

import com.xgp.order.feign.fallback.ProductFeignClientFallback;
import com.xgp.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(value = "service-product",//feign客户端
        fallback = ProductFeignClientFallback.class) //指定兜底回调属性
public interface ProductFeignClient {

    // mvc注解的两套使用逻辑
    @GetMapping("/api/product/product/{id}")
    Product getProductById(@PathVariable("id") Long id);
//                        @RequestHeader("token") String token);
}
